package com.xiaomei.manager.utils;

import java.util.Random;


public class ValidCodeUtils {
	
	/**
	* 获取指定数量的随机字符串
	* @param length
	* @return
	*/
	public static String getRandNum(int charCount) {
        String charValue = "";
        Random r = new Random();
        for (int i = 0; i < charCount; i++) {
            int num = r.nextInt(10);
            charValue += String.valueOf(num);
        }
        return charValue;

    }
	
	/**
	 * 测试当前时间与上次sesssion时间是否相差90s,True表示当前时间符合要求，
	 * @param CurrentTime
	 * @param LastTime
	 * @return
	 */
	
	public static boolean ValidTimeCheck(Long CurrentTime,Long LastTime){
		
		if((CurrentTime-LastTime)/1000 < 120){
			return true;
		}else{
			return false;
		}
		
		
	}
	

	
	public static void main(String[] args){
		System.out.println(ValidCodeUtils.ValidTimeCheck(10988001111l, 10988001110l));
	}
	
}
